@extends('admin.layouts.index')
@section('title', '用户充值提现')

@section('content')

@if($type == 1)
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <div class="card-title">账户余额提现</div>
            </div>
            <form id="comment-form" method="POST" action="{{ url('admin/users/withdrawal') }}">
            <div class="card-body">
                <div class="form-group">
                    <label for="text">账户余额：</label>
                    <input type="text" class="form-control" name="money" placeholder="请在此输入提现金额" value="{{ Auth::user()->money }}">
                    @csrf
                </div>
                <div class="form-group">
                    <label for="text">支付宝账户：</label>
                    <input type="text" class="form-control" name="alipay" placeholder="请在此输入提现支付宝" value="{{ old('alipay') }}">
                </div>
                <div class="form-group">
                    <label for="text">支付宝名称：</label>
                    <input type="text" class="form-control" name="name" placeholder="请在此输入提现支付宝名称" value="{{ old('name') }}">
                </div>
                <div class="form-group">
                    <button class="btn btn-primary">立即提现</button>
                </div>
            </div>
            </form>
        </div>
    </div>
</div>
@else
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <div class="card-title">获取推广链接</div>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <div class="form-control-static" style="margin: 30px 0px;">
                        <p>使用下方推广码推广注册即可获得提成。</p>
                        <p class="text-primary">{{ url('/admin/login') }}?code={{ $invitation_code }}</p>
                        <span class="btn btn-primary" id="copylinks" data-clipboard-text="{{ url('/admin/login') }}?code={{ $invitation_code }}">复制推广链接</span>
                    </div>
                    <div class="form-control-static">
                        <div class="card-title" style="margin-bottom: 10px;border-bottom: thin solid #E6E6E5;padding-bottom: 10px;">天天外链提成规则</div>
                            <div id="describe">
                                1、使用小程序码/链接邀请对方注册天天外链即为邀请成功；<br>
                                2、对方充值/续费您即可获得佣金；<br>
                                3、佣金根据您的销售额进行分级；<br>
                                4、每月充值金额0-1000元提成10%；<br>
                                5、每月充值金额1000-5000元提成20%；<br>
                                6、每月充值金额5000-10000元提成30%；<br>
                                7、活动规则可能随时调整，具体以通知为准。<br>
                            </div>
                    </div>
                </div>
                <!-- <div class="form-group">
                    <label for="text">复制推广链接：</label>
                    <button class="btn btn-primary">点击复制链接</button>
                </div> -->
            </div>
        </div>
    </div>
</div>

<script src="https://file.wailian1.cn/admin/js/public/clipboard.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var clipboardl = new ClipboardJS("#copylinks");
        clipboardl.on('success', function(e) {
            toastSuccess("推广链接复制成功","链接复制成功，粘贴即可获取外链！");
        });
    });
</script>
@endif

@endsection
